package com.example.administrator.xiaoxiang.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2017/1/6.
 * 这是tab的adapter
 */

public class HomeFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> data;
    private List<String> arrs;
    public HomeFragmentAdapter(FragmentManager fm,List<Fragment> data,List<String> arrs) {
        super(fm);
        this.data = data;
        this.arrs = arrs;
    }

    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {

        return arrs.get(position);
    }
}
